/*************************************************************************
 *
 *   file		: RegenPercentOfTotalMana.cs
 *   copyright		: (C) The WCell Team
 *   email		: info@wcell.org
 *   last changed	: $LastChangedDate: 2009-06-12 20:37:34 +0100 (Fri, 12 Jun 2009) $
 *   last author	: $LastChangedBy: dominikseifert $
 *   revision		: $Rev: 965 $
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *************************************************************************/

using WCell.Constants.Spells;
using WCell.RealmServer.Entities;

namespace WCell.RealmServer.Spells.Auras.Handlers
{
	/// <summary>
	/// Regenerates a percentage of your total Mana every tick
	/// </summary>
	public class RegenPercentOfTotalManaHandler : AuraEffectHandler
	{
		protected internal override void CheckInitialize(WorldObject caster, Unit target, ref SpellFailedReason failReason)
		{
			//if (target.PowerType != WCell.Core.PowerType.Mana) {
			//    failReason = SpellFailedReason.AlreadyAtFullPower;
			//}
		}

		protected internal override void Apply()
		{
			m_aura.Auras.Owner.Energize(m_aura.Caster, (int)((float)EffectValue * (m_aura.Auras.Owner.MaxPower)), m_spellEffect);
		}

	}
};
